﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using CarolLib.Configuration;

namespace DispatchAssist.BusinessLogical.Configuration
{
    public class ShareDicDownloadSetting
    {
        public ShareDicDownloadSetting(XmlNode node)
        {
            XmlAttributeCollection atts = node.Attributes;
            this.ShareDicPath = ConfigurationBase.GetStringAttribute(atts, "sharedicpath", string.Empty);
            this.FilePath = ConfigurationBase.GetStringAttribute(atts, "filepath", string.Empty);

            this.RecentDays = ConfigurationBase.GetIntAttribute(atts, "recentdays", 365);
            this.DownloadInterval = ConfigurationBase.GetIntAttribute(atts, "downloadinterval", 3000);
            this.DownImmediately = ConfigurationBase.GetBoolAttribute(atts, "downimmediately", false);
            //this.MessageType = ConfigurationBase.GetStringAttribute(atts, "messagetype", string.Empty);
            this.CleanInterval = ConfigurationBase.GetIntAttribute(atts, "cleaninterval", 3000);
            this.EnableClean = ConfigurationBase.GetBoolAttribute(atts, "enableclean", false);
        }

        #region Properties

        public string ShareDicPath { get; set; }
        public string FilePath { set; get; }
        public int RecentDays { get; set; }
        public int DownloadInterval { get; set; }
        public bool DownImmediately { get; set; }
        public int CleanInterval { get; set; }
        public bool EnableClean { get; set; }
        #endregion
    }
}
